package com.fc.mall.portal.constants;

import org.apache.commons.lang3.StringUtils;

public class ProductContants {

    public enum ServiceCategory {
        NO_WORRY_RETURN("1", "无忧退货"),
        QUICK_REFUND("2", "快速退款"),
        FREE_SHIPPING("3", "免费包邮"),
        ;

        private String id;
        private String val;

        ServiceCategory(String id, String val) {
            this.id = id;
            this.val = val;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getVal() {
            return val;
        }

        public void setVal(String val) {
            this.val = val;
        }

        public static String getVal(String id) {
            for (ServiceCategory category : ServiceCategory.values()) {
                if (category.getId().equals(id)) {
                    return category.getVal();
                }
            }
            return StringUtils.EMPTY;
        }
    }
}
